package com.songyuesheng.app.controller;

import com.songyuesheng.app.service.LogsService;
import com.songyuesheng.app.commom.Result;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class LogsController {

    @Resource
    private LogsService logsService;

    @DeleteMapping("/delLog/{id}")
    public Result<?> delLog(@PathVariable Integer id) {
        return logsService.delLog(id);
    }

    @DeleteMapping("/delBatchLogs")
    public Result<?> delLogs(@RequestBody List<Integer> ids) {
        return logsService.delLogs(ids);
    }

    @GetMapping("/selectLogByPage")
    public Result<?> selectLogByPage(@RequestParam Integer pageNum,
                                     @RequestParam Integer pageSize,
                                     @RequestParam String operation,
                                     @RequestParam String type,
                                     @RequestParam String user) {
        return logsService.selectLogByPage(pageNum, pageSize, operation, type, user);
    }
}